import VueRouter from 'vue-router'
//用户管理---------------------------

import User from '@/views/User'
import DepManage from '@/views/User/DepManage'
import OnlineUser from '@/views/User/OnlineUser'
import PosManage from '@/views/User/PosManage'
import UserManage from '@/views/User/UserManage'
import AddPos from "@/views/User/PosManage/addPos.vue"
import AddUser from "@/views/User/UserManage/addUser.vue";

export default
  [
    {
      path: '/user',
      name: 'user',
      meta: {
        title: "用户管理"
      },
      component: User,
      children: [
        {
          path: 'depManage',
          name: 'depManage',
          meta: {
            title: "部门管理"
          },
          component: DepManage,
        },
        /* children:[
          {
            path:'/',
            name:'depManage1',
            meta:{
              title:"部门管理"
            },
            component :() => import ("../views/User/DepManage/home.vue")
          }, */
        {
          path: 'addDep',
          name: 'addDep',
          meta: {
            title: "部门新增"
          },
          component: () => import("../views/User/DepManage/addDep.vue")
        },
        {
          path:'addChildrenDep',
          name:'addChildrenDep',
          meta:{
            title:"新增子部门"
          },
          component: () => import("../views/User/DepManage/addChildrenDep.vue")
        },
        {
          path: 'changeDep',
          name: 'changeDep',
          meta: {
            title: "部门修改"
          },
          component: () => import("../views/User/DepManage/changeDep.vue")
        },
        {
          path: 'userManage',
          name: 'userManage',
          meta: {
            title: "用户管理"
          },
          component: UserManage,
        },

        /* {
          path:'/',
          meta:{
            title:'用户管理'
          },
          component: () => import ("../views/User/UserManage/home.vue")
        }, */
        {
          path: 'addUser',
          name: 'addUser',
          meta: {
            title: "用户新增"
          },
          component: AddUser,
        },
        {
          path:'changeUser',
          name:'changeUser',
          meta:{
            title:'用户修改'
          },
          component: () => import ("../views/User/UserManage/changeUser.vue")
        },
        {
          path: 'posManage',
          name: 'posManage',
          meta: {
            title: "职位管理"
          },
          component: PosManage,
        },
        /* children:[
          {
            path:'/',
            meta:{
              title:'职位管理'
            },
            component: () => import ("../views/User/PosManage/home.vue")
          }, */
        {
          path: 'addPos',
          name: 'addPos',
          meta: {
            title: "职位新增"
          },
          component: AddPos,
        },
        {
          path: 'changePos',
          name: 'changePos',
          meta: {
            title: "职位修改"
          },
          component: () => import("../views/User/PosManage/changePos.vue")
        },
        {
          path: 'onlineUser',
          name: 'onlineUser',
          meta: {
            title: "在线用户"
          },
          component: OnlineUser,
        },
      ]
    },

  ]
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

